# 得到线性电机的频率、加速度和振动幅值之间的关系
import numpy as np


def freq(A, a):
    return 1 / (4 * np.sqrt(A/a))


def ampl(f, a):
    return 16 * f**2 * a


def acce(A, f):
    return A / (16 * f**2)


if __name__ == '__main__':
    m = 20
    n = 10
    a = np.ones([m, n])
    for i in range(m):  # 1 到 20 Hz
        for j in range(n):  # 1 到 10 mm
            f = i + 1
            A = j + 1
            a[i][j] = acce(f, A)
